home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Workbench Add-On
/
Workbench Add-On - Volume 1.iso
/
BBS-Archive
/
Comm
/
term-source.lha
/
Extras
/
Source
/
term-Source.lha
/
xem.h
< prev
next >
Wrap
C/C++ Source or Header
|
1994-07-30
|
6KB
|
179 lines
/**
*
* Include file for External Emulator Handling
*
**/
/*
* The structure
*/
struct XEM_IO
{
struct Window *xem_window;
struct TextFont *xem_font;
APTR xem_console;
STRPTR xem_string;
ULONG *xem_signal;
UWORD xem_screendepth;
UWORD xem_pad;
ULONG (* __asm xem_sread)(register __a0 APTR,register __d0 LONG,register __d1 ULONG);
LONG (* __asm xem_swrite)(register __a0 STRPTR,register __d0 LONG);
LONG (* __asm xem_sflush)(VOID);
LONG (* __asm xem_sbreak)(VOID);
ULONG (* __asm xem_squery)(VOID);
VOID (* __asm xem_sstart)(VOID);
LONG (* __asm xem_sstop)(VOID);
VOID (* __asm xem_tbeep)(register __d0 ULONG,register __d1 ULONG);
LONG (* __asm xem_tgets)(register __a0 STRPTR,register __a1 STRPTR,register __d0 ULONG);
ULONG (* __asm xem_toptions)(register __d0 LONG,register __a0 struct xem_option **);
LONG (* __asm xem_process_macrokeys)(register __a0 struct XEmulatorMacroKey *);
};
#if 0
struct XEM_IO
{
struct Window *xem_window;
struct TextFont *xem_font;
APTR xem_console;
STRPTR xem_string;
ULONG *xem_signal;
UWORD xem_screendepth;
UWORD xem_pad;
ULONG (*xem_sread)();
LONG (*xem_swrite)();
LONG (*xem_sflush)();
LONG (*xem_sbreak)();
ULONG (*xem_squery)();
VOID (*xem_sstart)();
LONG (*xem_sstop)();
VOID (*xem_tbeep)();
LONG (*xem_tgets)();
ULONG (*xem_toptions)();
LONG (*xem_process_macrokeys)();
};
#endif
/*
* The xem_option structure
*/
struct xem_option
{
STRPTR xemo_description; /* description of the option */
ULONG xemo_type; /* type of option */
STRPTR xemo_value; /* pointer to a buffer with the current value */
ULONG xemo_length; /* buffer size */
};
/*
* Valid values for xemo_type are:
*/
#define XEMO_BOOLEAN 1L /* xemo_value is "yes", "no", "on" or "off" */
#define XEMO_LONG 2L /* xemo_value is string representing a number */
#define XEMO_STRING 3L /* xemo_value is a string */
#define XEMO_HEADER 4L /* xemo_value is ignored */
#define XEMO_COMMAND 5L /* xemo_value is ignored */
#define XEMO_COMMPAR 6L /* xemo_value contains command parameters */
struct XEmulatorMacroKey
{
struct MinNode xmk_Node;
UWORD xmk_Qualifier;
UBYTE xmk_Type;
UBYTE xmk_Code;
APTR xmk_UserData;
};
/*----- Qualifiers for XMK_QUALIFIER -----*/
#define XMKQ_NONE 0
#define XMKQ_SHIFT 1
#define XMKQ_ALTERNATE 2
#define XMKQ_CONTROL 3
/*----- Types for XMK_TYPE -----*/
#define XMKT_IGNORE 1
#define XMKT_RAWKEY 2
#define XMKT_COOKED 3
/*----- Types for XEmulatorInfo -----*/
#define XEMI_CURSOR_POSITION 1 /* home = 1,1 */
#define XEMI_CONSOLE_DIMENSIONS 2
/*----- Macros for XEmulatorInfo -----*/
#define XEMI_EXTRACT_Y_POSITION(result) (result >> 16)
#define XEMI_EXTRACT_X_POSITION(result) (result & 0xffff)
#define XEMI_EXTRACT_COLUMNS(result) (result >> 16)
#define XEMI_EXTRACT_LINES(result) (result & 0xffff)
/*----- Modes for XEmulatorPreferences -----*/
#define XEM_PREFS_RESET 0 /* Reset to builtin defaults */
#define XEM_PREFS_LOAD 1 /* Load preferences from file */
#define XEM_PREFS_SAVE 2 /* Save preferences to file */
struct XEmulatorHostData
{
STRPTR Source;
STRPTR Destination;
BOOL InESC; /* INTER-EMULATOR PRIVATE DATA.. DO NOT TOUCH 'EM..!! */
BOOL InCSI; /* INTER-EMULATOR PRIVATE DATA.. DO NOT TOUCH 'EM..!! */
};
BOOL XEmulatorSetup(struct XEM_IO *io);
BOOL XEmulatorOpenConsole(struct XEM_IO *io);
VOID XEmulatorCloseConsole(struct XEM_IO *io);
VOID XEmulatorCleanup(struct XEM_IO *io);
VOID XEmulatorWrite(struct XEM_IO *io, STRPTR string, ULONG len);
BOOL XEmulatorSignal(struct XEM_IO *io, ULONG sig);
ULONG XEmulatorHostMon(struct XEM_IO *io, struct XEmulatorHostData *hd, ULONG actual);
ULONG XEmulatorUserMon(struct XEM_IO *io, STRPTR retstr, ULONG maxlen, struct IntuiMessage *imsg);
BOOL XEmulatorOptions(struct XEM_IO *io);
BOOL XEmulatorClearConsole(struct XEM_IO *io);
BOOL XEmulatorResetConsole(struct XEM_IO *io);
BOOL XEmulatorResetTextStyles(struct XEM_IO *io);
BOOL XEmulatorResetCharset(struct XEM_IO *io);
ULONG XEmulatorGetFreeMacroKeys(struct XEM_IO *io, ULONG qualifier);
BOOL XEmulatorMacroKeyFilter(struct XEM_IO *io, struct List *keys);
ULONG XEmulatorInfo(struct XEM_IO *xem_io, ULONG type);
BOOL XEmulatorPreferences(struct XEM_IO *xem_io, STRPTR fileName, ULONG mode);
#ifdef LATTICE
/* Pragmas for SAS/Lattice-C V5.0 */
#pragma libcall XEmulatorBase XEmulatorSetup 1E 801
#pragma libcall XEmulatorBase XEmulatorOpenConsole 24 801
#pragma libcall XEmulatorBase XEmulatorCloseConsole 2A 801
#pragma libcall XEmulatorBase XEmulatorCleanup 30 801
#pragma libcall XEmulatorBase XEmulatorWrite 36 9803
#pragma libcall XEmulatorBase XEmulatorSignal 3C 802
#pragma libcall XEmulatorBase XEmulatorHostMon 42 9803
#pragma libcall XEmulatorBase XEmulatorUserMon 48 A09804
#pragma libcall XEmulatorBase XEmulatorOptions 4E 801
#pragma libcall XEmulatorBase XEmulatorClearConsole 54 801
#pragma libcall XEmulatorBase XEmulatorResetConsole 5A 801
#pragma libcall XEmulatorBase XEmulatorResetTextStyles 60 801
#pragma libcall XEmulatorBase XEmulatorResetCharset 66 801
#pragma libcall XEmulatorBase XEmulatorGetFreeMacroKeys 6c 802
#pragma libcall XEmulatorBase XEmulatorMacroKeyFilter 72 9802
#pragma libcall XEmulatorBase XEmulatorInfo 78 802
#pragma libcall XEmulatorBase XEmulatorPreferences 7E 9803
#endif